﻿using System.ComponentModel;
using System.Windows;
using System.Windows.Input;
using GlobalizationTools.ViewModel;

namespace GlobalizationTools
{
    /// <summary>
    /// Interaction logic for Window1.xaml
    /// </summary>
    public partial class MainWindow : Window
    {

        public MainWindow()
        {
            InitializeComponent();
        }

        private void Window_Closing(object sender, CancelEventArgs e)
        {
            bool result = true;
            foreach (TreeViewItemViewModel model in RootModel.Children)
            {
                if (!model.Close())
                {
                    result = false;
                    break;
                }
            }
            e.Cancel = !result;
        }

        private void MenuItem_Click(object sender, RoutedEventArgs e)
        {
            AboutWindow window = new AboutWindow();
            window.Owner= this;
            window.ShowDialog();
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            Mouse.OverrideCursor = null;
        }

    }
}
